import { getToken } from '@/utils/auth'

const defaultSettings = require('@/settings.js')

export default (_self) => {
  return {
    editBtn: true,
    delBtn: true,
    addBtn: true,
    labelWidth: 140,
    index: true,
    indexLabel: '序号',
    align: 'center',
    headerAlign: 'center',
    border: true,
    dialogWidth: '50%',
    stripe: false,
    searchShow: false,
    searchShowBtn: false,
    size: 'mini',
    // excelBtn: true,
    // selection: true,
    searchMenuSpan: 4,
    props: {
      label: 'label',
      value: 'value'
    },
    column: [

      {
        label: '所属项目',
        prop: 'chargeId',
        type: 'select',
        dicHeaders: {
          Authorization: getToken()
        },
        dicUrl: `${defaultSettings.baseUrl}/charge/list`,
        props: {
          label: 'name',
          value: 'id',
          res: 'data'
        },
        rules: [
          {
            required: true,
            message: '请选择',
            trigger: 'blur'
          }
        ]
      },
      {
        prop: 'name',
        label: '课程名称',
        rules: [
          {
            required: true,
            message: '请输入',
            trigger: 'blur'
          }
        ]
      },
      {
        prop: 'trainTimes',
        label: '培训时间',
        type: 'textarea',
        rules: [
          {
            required: true,
            message: '请输入',
            trigger: 'blur'
          }
        ]
      }

    ]
  }
}
